# -*- coding: utf-8 -*-
from db.mysql import MysqlClient
from common.helper import Helper
class Arrangement( object ):
    def __init__(self):
        self.mysql = MysqlClient()
        self.name = "平安学生综合保险"
    def pullData(self, data={}):
        for item in Helper.selectData(self.name, self.mysql):
            data["name"] = self.name
            data["company"] = "平安保险"
            data["year"] = item["year"]
            data["expire"] = item["expire"]
            data["payType"] = item["payType"]
            data["accidentDeath"] = "0" if item["accidentDeath"] == "0" else str(int(int(item["accidentDeath"])/10000)) + "w"
            data["hospitalMedical"] = "0" if item["hospitalMedical"] == "0" else str(int(int(item["hospitalMedical"])/10000)) + "w"
            data["teenagerDisease"] = "0" if item["teenagerDisease"] == "0" else str(int(int(item["teenagerDisease"])/10000)) + "w"
            data["accidentHospital"] = "0" if item["accidentHospital"] == "0" else str(int(int(item["accidentHospital"])/10000)) + "w"
            data["accidentOutpatient"] = "0" if item["accidentOutpatient"] == "0" else item["accidentOutpatient"]
            data["accidentAllowance"] = "0" if item["accidentAllowance"] == "0" else item["accidentAllowance"]
            data["plan"] = item["plan"]
            data["price"] = item["price"]
            Helper.mergeTable( self.name,self.mysql,data )
if __name__ == '__main__':
    a = Arrangement()
    a.pullData()
